home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 21
/
CU Amiga Magazine's Super CD-ROM 21 (1998)(EMAP Images)(GB)[!][issue 1998-04].iso
/
CUCD
/
Programming
/
RTGMaster
/
devdocs
/
rtg3DExt.ad
< prev
next >
Wrap
Text File
|
1997-10-09
|
11KB
|
344 lines
rtg3DExt/ClrZBuf rtg3DExt/ClrZBuf
NAME
ClrZBuf - Clears the Z Buffer
SYNOPSIS
void ClrZBuf(RtgScreen)
A0
void ClrZBuf(struct RtgScreen *)
FUNCTION
Clears the Z Buffer. This function does not work yet.
INPUTS
RtgScreen - The used RtgScreen
SEE ALSO
rtg3DExt/ClearBuf rtg3DExt/ClearBuf
NAME
ClearBuf - Clears a Doublebuffering Buffer
SYNOPSIS
void ClearBuf(RtgScreen,BufNum)
A0 D0
void ClearBuf(struct RtgScreen *, ULONG)
FUNCTION
This function is used to clear the Back Buffer (it can also clear
the front buffer, but this does not make sense). This function
needs at least rtgCV3D.library V2.43 to work correctly.
Note that a
rtgCV3D.library screen (and possible screens of other 3D Sublibs also)
can only do 2 buffers, not 3.
Also note, that ClearBuf ONLY works if you do NOT promote the Screen !!!
This CANNOT be fixed, never promote a rtgCV3D.library screen, or you get
much flickering.
INPUTS
RtgScreen - The RtgScreen
BufNum - Number of the Buffer to clear
SEE ALSO
rtg3DExt/CreateTex rtg3DExt/CreateTex
NAME
CreateTex - Creates a Texture Handle
SYNOPSIS
struct TexHandle *CreateTex(RtgScreen,Tags)
D0 A0 A1
struct TexHandle *CreateTex(struct RtgScreen *,struct TagItem *)
FUNCTION
This function creates a texture handle. The provided tags list, which
features of the 3D Engine are to be used.
tex_TexMap: Address of the Texture-Map, which should be uploaded to the
Graphics Memory. Note: This is not the Address of the Texturemap
HANDLE, it is the address of the Texture itself !!!
tex_MapSize: The Size of this Map
tex_ColorFmt: The Color Format of the Texture-Map
tex_FilterType: The Filtering Type, that should be used for Texture Filtering
tex_TexWrap: Boolean Flag, if Texture-Wrapping should be used
tex_LitTex: Boolean Flag, if Lit-Texturing should be used
tex_AlphaBlend: The Alpha-Blending config
Take note, that uploading a texture to GFX Memory should only be done
at times where speed is not important. Also take note, that there
will be a "Screenmode-System" for Color-Formats and Filter-Types to
support Multiple Chipsets in a later version of this library. Also
take note, that this call is still to be expanded, and that you also
should check your Chipset3D structure if a certain operation is
available.
The Alpha Blending Values are :
ABlend_Source = -1
ABlend_None = 0
ABlend_Texture = 1
The Blending Values are :
Blend_Com = 0
Blend_Mod = 1
Blend_Decal = 2
The Color Formats are :
CF_ARGB32 = 0
CF_ARGB16 = 1 (RGB4444 !!!)
CF_ARGB15 = 2 (RGB1555 !!!)
CF_ALP4BLE4 = 3
CF_BLEND4LO = 4
CF_BLEND4HI = 5
CF_LUT8 = 6 (Palletized Data)
CF_YUYV16 = 7 (YUV Data)
These constants CHANGED, as the names used before (ARGB32...) were
already used by the smr_ChunkySupport tag. As the 3D Lib was not
yet released, this namechange is not a problem, though.
The Filter Types are :
TPPM1 = 0 (MIP-Mapping, not yet supported)
TPPM2 = 1 (Linear MIP-Mapping, not yet supported)
TPPM4 = 2 (Bi-linear MIP-Mapping, not yet supported)
TPPM8 = 3 (Tri-linear MIP-Mapping, not yet supported)
TPP1 = 4 (Point Sampling)
TPPV2 = 5 (For YUV Data)
TPP4 = 6 (Bi-Linear Mapping)
Also always have a look at the Chipset3D Flags:
0 Fogging and Alpha Blending cannot happen at the same time on this chip
1 Alpha Blending Objects can cause problems with Z-Buffering on this chip
2 Wrap-Around is not supported for p-correct textures on this chip
3 In Palettized Mode, this Chip only supports Decal Blending
4 Gouraud Shading does not work in Palettized Mode (Reasonable :) )
5 Lit-Texturing does not work in Palettized Mode (Reasonable :) )
The Chipset3D structure looks like the following, more info in 3DExt.guide:
struct Chipset3D
{
struct Library *Base3D; // This is the LibBase of rtg3DExt !!!
int mapping;
int p_mapping;
int filters;
int tmapclr;
int fog;
int blend;
int ablend;
int zbuf;
int mux;
int gouraud;
int lit;
int line;
int wrap;
int ovl;
int mem;
int size;
int lsize;
int flags;
};
The Chipset3D structure tells you the features of a chip, the max. size
of the textures, the 3DExt LibBase of the Chip, the Flags and how much
GFX Memory you have. You get the address of the structure using
GetRtgScreenData of rtgmaster.library. Z Buffering is enabled using
OpenRtgScreen of rtgmaster.library (but up to now it does not work).
The function does not upload the texture. This has to be done manually,
or using LoadTex.
If not enough texture memory is available, CreateTex() returns 0.
INPUTS
RtgScreen - The RtgScreen to use
Tags - The Tags to use
RESULTS
TexHandle - Pointer to the TexHandle of the created Texture
SEE ALSO
DeleteTex(),GetTexAttr(),SetTexAttr()
rtg3DExt/DeleteTex rtg3DExt/DeleteTex
NAME
DeleteTex - Frees a Texture Handle again.
SYNOPSIS
DeleteTex(RtgScreen,th)
A0 A1
void DeleteTex(struct RtgScreen *,struct TexHandle *)
FUNCTION
This function deletes a Texture Handle again. It does not free the memory
used by the Texture. This has to be done using FreeTex.
INPUTS
RtgScreen - The RtgScreen to which the TexHandle was applied
TexHandle - The Handle of the Texture to be deleted
SEE ALSO
CreateTex(),GetTexAttr(),SetTexAttr()
rtg3DExt/FreeTex rtg3DExt/FreeTex
NAME
FreeTex - Deletes a texture from GFX Memory again
SYNOPSIS
void FreeTex(RtgScreen,Tex, size)
A0 A1 D0
void FreeTex(struct RtgScreen *,void *, int)
FUNCTION
This function removes a texture from the Memory
Buffer again. The Memory Buffer is used as temporary
Buffer until CreateTex uploads the Texture is uploaded
to the GFX Memory. FreeTex clears this Buffer again.
INPUTS
RtgScreen - The RtgScreen
Tex - The Memory Buffer for the texture
size - The Size of the Texture
SEE ALSO
LoadTex()
rtg3DExt/GetTexAttr rtg3DExt/GetTexAttr
NAME
GetTexAttr - To get the values set in a TexHandle
SYNOPSIS
ULONG GetTexAttr(RtgScreen,TexHandle,AttrNum)
D0 A0 A1 D0
ULONG GetTexAttr(struct RtgScren *,struct TexHandle *,ULONG)
FUNCTION
Using this function, you can re-read the value of the Attributes
you set using CreateTex. Not yet implemented.
INPUTS
RtgScreen - The RtgScreen to use
TexHandle - The TexHandle to use
AttrNum - The Attribute to change
SEE ALSO
SetTexAttr()
rtg3DExt/LoadTex rtg3DExt/LoadTex
NAME
LoadTex - Uploads a texture to the GFX Memory
SYNOPSIS
void LoadTex(RtgScreen,name, size)
A0 A1 D0
void LoadTex(struct RtgScreen *,void *,char *, int)
FUNCTION
This function loads the Texture to a temporary Buffer (as it cannot
be uploaded from diskdrive to GFX Memory directly), before CreateTex
uploads it to the GFX Memory.
INPUTS
RtgScreen - The RtgScreen to use
name - The filename under which the texture data is stored
size - The size of the texture
SEE ALSO
FreeTex()
rtg3DExt/PaintT3D rtg3DExt/PaintT3D
NAME
PaintT3D - Paints textured or shaded triangles to the Screen
SYNOPSIS
PaintT3D(RtgScreen,TexHandle,BlendType)
A0 A1 D0
void PaintT3D(struct RtgScreen *,struct TexHandle *,ULONG)
FUNCTION
This function renders a triangle, specified as
typedef struct
{
long x,y,z,u,v;
long color;
} Point3D;
typedef struct
{
Point3D p1,p2,p3;
struct TexHandle *th;
} Triangle3D;
The Triangle is described by three points with polygon- and
texture-coordinates. The color is for the use of Gouraud-Shading
or Lit-Texturing. The Texture-Handle indicates the texture to use.
The BlendType can be used to light up or to darken the image. Normally
only 15/16/24 Bit Screens support this fully. You should use Doublebuffering
to display the textures. Sadly, i did not yet get this function work together
with Back-Bitmap-Clearing. But well... this is an Alpha Version.
INPUTS
RtgScreen - The RtgScreen to use
TexHandle - The TexHandle to use
BlendType - The BlendType to use
SEE ALSO
CreateTex()
rtg3DExt/SetTexAttr rtg3DExt/SetTexAttr
NAME
SetTexAttr - To change the values set in a TexHandle
SYNOPSIS
void GetTexAttr(RtgScreen,TexHandle,AttrNum,Value)
A0 A1 D0 D1
void GetTexAttr(struct RtgScren *,struct TexHandle *,ULONG,ULONG)
FUNCTION
Using this function, you can re-set the value of the Attributes
you set using CreateTex with different values. Not yet implemented.
INPUTS
RtgScreen - The RtgScreen to use
TexHandle - The TexHandle to use
AttrNum - The Attribute to change
Value - The new value
SEE ALSO
GetTexAttr()